home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1988 December
/
1988-12.d64
/
double take
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
6KB
|
176 lines
10 rem copyright 1988 compute! publications, inc. - all rights reserved
20 poke646,0:poke53280,15:poke53281,15:print"[147]";tab(11)"copyright 1988"
25 printtab(6)"compute! publications, inc."
30 printtab(9)"all rights reserved"
40 fori=1to9:reada$:next:fori=1to380:reada:x=x+a:next
50 ifx<>14781thenprint"error in data statement.":stop
60 restore:goto130
70 gosub1740:print"[144]"spc(14)"it's a draw":goto90
80 gosub1740:poke646,cl(pl):print""spc(8)"player"pl+1"[157] is the winner"
90 poke646,i:print""spc(8)"press firebutton to play"
100 i=i+1:ifi>=15theni=0
110 jb=16-peek(56320)and16:ifjb=0thenrun
120 goto90
130 gosub1740:print"[147]";:poke53280,15:poke53281,15:poke53289,5
140 printspc(13)"[144][176][201][157][157][194][194]ouble [145][195][178][195][195][195]":printspc(13)"[173][203] [145] [194]ake"
150 printspc(22)"[173]":print""spc(12)"1[146] or 2[146] joysticks":c$=""
160 poke198,0:wait198,1:getc$:ifc$<"1"orc$>"2"then160
170 f2=val(c$)-1
180 printspc(10)"[145]p l e a s e w a i t"
190 dimdu(25),b(2,25),fl(2,25),a$(2,25),an(2,25),zz(25),bb(25,4),bc(2,30)
200 cr$="tu[157][157]vw":dn=189:up=93:lm=45:rm=126
210 fori=1to9:readte$(i):next
220 fori=1to25:bc(1,i)=2:bc(2,i)=2:next
230 tv=53248:poketv+21,4:poke2042,11:fori=0to62:readq:poke704+i,q:next
240 ml$="[162]"+chr$(8)+"[189]<"+chr$(3)+"[149]x[202]"+chr$(16)+chr$(248)+"l[191][163]":poke835,0
250 poke53272,peek(53272)and240or12
260 poke836,208:poke830,0:poke831,216:poke828,0:poke829,56:poke56334,0
270 poke1,51:ml$=ml$:sys(peek(51)+256*peek(52)):poke1,55:poke56334,1
280 fori=13312to13503:readj:pokei,j:next
290 fori=1to25:readzz(i):next
300 fori=1to25:forx=1to4:readbb(i,x):next:next
310 forq=1to2:fori=1to25:dummy(i)=1:next:fori=1to25
320 x=int(25*rnd(1))+1:ifdummy(x)=0then320
330 b(q,i)=x:dummy(x)=0:next
340 fori=1to25:ifb(q,i)<10thena$(q,i)=te$(b(q,i)):goto360
350 a$(q,i)=right$(str$(b(q,i)),2)
360 nexti,q
370 fori=1to25:an(1,i)=b(1,i):forz=1to25
380 ifb(2,z)=an(1,i)thenan(2,i)=z:z=25:nextz,i:goto400
390 nextz
400 print"[155]";:a=1:b=5
410 fori=1to5:forw=atob
420 print""a$(1,w);:next:print"";
430 forw=atob:print""a$(2,w);:next:print""
440 a=a+5:b=b+5:print"";:nexti
450 poke53280,11:poke53281,11:cl(0)=14:cl(1)=7
460 print"[144]"
470 print" [176][195][195][178][195][195][178][195][195][178][195][195][178][195][195][174] [176][195][195][178][195][195][178][195][195][178][195][195][178][195][195][174]"
480 print" [194][194][194][194][194][194][194][194][194][194][194][194]"
490 print" [194][194][194][194][194][194][194][194][194][194][194][194]"
500 fori=1to4:print" [171][195][195][219][195][195][219][195][195][219][195][195][219][195][195][179] [171][195][195][219][195][195][219][195][195][219][195][195][219][195][195][179]"
510 print" [194][194][194][194][194][194][194][194][194][194][194][194]"
520 print" [194][194][194][194][194][194][194][194][194][194][194][194]":next
530 print" [173][195][195][177][195][195][177][195][195][177][195][195][177][195][195][189] [173][195][195][177][195][195][177][195][195][177][195][195][177][195][195][189]";
540 qx=95:qy=45:mt=1:gosub1020
550 poketv+4,qy:poketv+5,qx:poke53271,peek(53271)or(2^2)
560 poke53289,cl(pl):gosub890
570 ifbc(1,mt)<>2thenpoke53280,cl(pl):fori=1to1000:next:poke53280,11:goto560
580 poke646,cl(pl):uv=mt
590 p=mt:y1=5:gosub810:printcr$:bc(1,mt)=pl:mm=mt:xr=r1
600 ifbb(mt,1)=0then620
610 ifbc(1,bb(mt,1))=-pl+1andbc(1,bb(mt,2))=-pl+1then y1=5:goto650
620 ifbb(mt,3)=0then690
630 ifbc(1,bb(mt,3))=-pl+1andbc(1,bb(mt,4))=-pl+1theny1=5:goto670
640 goto690
650 bc(1,bb(mt,1))=pl:bc(1,bb(mt,2))=pl:p=bb(mt,1)
660 gosub810:printcr$:p=bb(mt,2):gosub810:printcr$:goto620
670 bc(1,bb(mt,3))=pl:bc(1,bb(mt,4))=pl:p=bb(mt,3)
680 gosub810:printcr$:p=bb(mt,4):gosub810:printcr$
690 p=an(2,mt):pp=p:kt=1:gosub800:yr=r2:bc(2,p)=pl:tm=p:ifbb(tm,1)=0then710
700 ifbc(2,bb(tm,1))=-pl+1andbc(2,bb(tm,2))=-pl+1then740
710 ifbb(tm,3)=0then780
720 ifbc(2,bb(tm,3))=-pl+1andbc(2,bb(tm,4))=-pl+1then760
730 goto780
740 bc(2,bb(tm,1))=pl:bc(2,bb(tm,2))=pl:p=bb(tm,1):kt=1
750 gosub810:printcr$:p=bb(tm,2):kt=1:gosub810:print cr$:goto710
760 bc(2,bb(tm,3))=pl:bc(2,bb(tm,4))=pl:p=bb(tm,3):kt=1
770 gosub810:printcr$:p=bb(tm,4):kt=1:gosub810:printcr$
780 gosub1460:pl=-pl+1:turn=turn+1:ifturn=25then70
790 goto560
800 gosub810:printcr$:return
810 poke646,cl(pl):ifp<6thenck=1:kc=1:goto860
820 ifp<11thenck=2:kc=4:goto860
830 ifp<16thenck=3:kc=7:goto860
840 ifp<21thenck=4:kc=10:goto860
850 ck=5:kc=13
860 ifktthentemp=5*ck-p:xx=(38-te*3)-3:yy=y1+kc:gosub880:kt=0:r2=ck:return
870 temp=5*ck-p:xx=(24-te*3)-9:yy=y1+kc:gosub880:r1=ck:return
880 poke783,0:poke781,yy:poke782,xx:sys65520:return
890 jy=15-(peek(56320+pl*f2)and15):jb=peek(56320+pl*f2)and16
900 ifjb=0thenreturn
910 ifjy=8thenjy=3
920 ifjy<1orjy>4then890
930 onjygoto940,960,980,1000
940 ifqx-4<upthen890
950 qx=qx-24:mt=mt-5:gosub1020:goto890
960 ifqx+4>dnthen890
970 qx=qx+24:mt=mt+5:gosub1020:goto890
980 ifqy+4>rmthen890
990 qy=qy+24:mt=mt+1:gosub1020:goto890
1000 ifqy-4<lmthen890
1010 qy=qy-24:mt=mt-1:gosub1020:goto890
1020 poketv+4,qy:poketv+5,qx:return
1030 data "01","02","03","04","05","06","07","08","09"
1040 data255,255,252,192,0,12,192,0
1050 data12,192,0,12,192,0,12,192
1060 data0,12,192,0,12,192,0,12
1070 data192,0,12,192,0,12,255,255
1080 data252,0,0,0,0,0,0,0
1090 data0,0,0,0,0,0,0,0
1100 data0,0,0,0,0,0,0,0
1110 data0,0,0,0,0,0,0
1120 data 0,0,0,0,60,102,102,110
1130 data 0,0,0,0,24,24,56,24
1140 data 0,0,0,0,60,102,6,12
1150 data 0,0,0,0,60,102,6,28
1160 data 0,0,0,0,6,14,30,54
1170 data 0,0,0,0,126,96,96,124
1180 data 0,0,0,0,60,102,96,96
1190 data 0,0,0,0,126,102,12,24
1200 data 0,0,0,0,60,102,102,60
1210 data 0,0,0,0,60,102,102,102
1220 data 118,102,102,60,0,0,0,0
1230 data 24,24,24,126,0,0,0,0
1240 data 12,48,96,126,0,0,0,0
1250 data 28,6,102,60,0,0,0,0
1260 data 102,127,6,6,0,0,0,0
1270 data 6,6,102,60,0,0,0,0
1280 data 124,102,102,60,0,0,0,0
1290 data 24,24,24,24,0,0,0,0
1300 data 60,102,102,60,0,0,0,0
1310 data 62,6,102,60,0,0,0,0
1320 data 0,7,31,63,127,127,255,255
1330 data 0,224,248,252,254,254,255,255
1340 data 255,255,127,127,63,31,7,0
1350 data 255,255,254,254,252,248,224,0
1360 data 2,3,3,3,2
1370 data 3,4,4,4,3
1380 data 3,4,4,4,3
1390 data 3,4,4,4,3
1400 data 2,3,3,3,2
1410 data 2,6,0,0,1,3,0,0,2,4,0,0,3,5,0,0,4,10,0,0
1420 data 1,11,0,0,6,8,2,12,7,9,3,13,8,10,4,14,5,15,0,0
1430 data 6,16,0,0,11,13,7,17,12,14,8,18,13,15,9,19,10,20,0,0
1440 data 11,21,0,0,16,18,12,22,17,19,13,23,18,20,14,24,15,25,0,0
1450 data 16,22,0,0,21,23,0,0,22,24,0,0,23,25,0,0,20,24,0,0
1460 ford=1to2
1470 jj=0
1480 fori=1to5:gosub1530:nexti:gosub1560
1490 fori=6to10:gosub1530:nexti:gosub1560
1500 fori=11to15:gosub1530:nexti:gosub1560
1510 fori=16to20:gosub1530:nexti:gosub1560
1520 fori=21to25:gosub1530:nexti:gosub1560:nextd:goto1580
1530 ifbc(d,i)=2thenjj=jj+15:goto1550
1540 jj=jj+bc(d,i)
1550 return
1560 ifjj/5=plthen80
1570 jj=0:return
1580 ford=1to2
1590 jj=0
1600 fori=1to21step5:gosub1650:nexti:gosub1680
1610 fori=2to22step5:gosub1650:nexti:gosub1680
1620 fori=3to23step5:gosub1650:nexti:gosub1680
1630 fori=4to24step5:gosub1650:nexti:gosub1680
1640 fori=5to25step5:gosub1650:nexti:gosub1680:nextd:goto1700
1650 ifbc(d,i)=2thenjj=jj+15:goto1670
1660 jj=jj+bc(d,i)
1670 return
1680 ifjj/5=plthen80
1690 jj=0:return
1700 ford=1to2
1710 ifbc(d,1)=plandbc(d,7)=plandbc(d,13)=plandbc(d,19)=plandbc(d,25)=plthen80
1720 ifbc(d,5)=plandbc(d,9)=plandbc(d,13)=plandbc(d,17)=plandbc(d,21)=plthen80
1730 x=(yr*5)-4:c1=pp-((yr*5)-4)+1:jj=0:i=x:next d:return
1740 poke53252,0:poke53253,0:return